import DEFINE = require('./../../common/DEFINE');
import GCJ_CLASS_TYPE = require('./../../common/GCJ_CLASS_TYPE');
import Serializer=require('./Serializer');
var CONFIG=require('../../../../common/config');
export  = SJGObjectIndex;
    
/**
 *
 * @author 
 *
 */
class SJGObjectIndex extends Serializer{
    public page: number = DEFINE.ID_NONE; // 页的id
    public object: number = DEFINE.ID_NONE; // 对象的id
	public constructor() {
        super();
        
        this.ct = GCJ_CLASS_TYPE.CLASS_TYPE_SJGObjectIndex;
	}
	
    // 从json对象(注意不是json字符串)中解析
    public fromJson(jsonObj, versionId) { 
        super.fromJson(jsonObj,versionId);
        
        this.page = jsonObj.page;
        this.object = jsonObj.object;                        
    }
    // 转成json字符串
    public toJson():string {                                                                      
        // 去掉父json字符串的头尾
        var superJson = super.toJson();
        superJson = superJson.substr(1,superJson.length-2);
                                                        
        var ret = '{';
            ret +=superJson;  
            
        // page
        ret +=',';
        ret += '"page":';
        ret += this.page;
        
        // object
        ret +=',';
        ret += '"object":';
        ret += this.object;
                                                                                                                                
        ret+='}';
        return ret;
    }   
//SJG_MARK_APPEND--------------------


}//SJG_MARK_END-------------------------